﻿using Management.Core;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Management.Areas.Control.Models
{
    /// <summary>
    /// 添加管理员视图模型
    /// </summary>
    public class AddAdminViewModel
    {
        /// <summary>
        /// 帐号
        /// </summary>
        [Required(ErrorMessage = "必须输入{0}")]
        [StringLength(30, MinimumLength = 4, ErrorMessage = "{0}长度为{2}-{1}个字符")]
        [Display(Name = "帐号")]
        public string Accounts { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "必须输入{0}")]
        [StringLength(20, MinimumLength = 6, ErrorMessage = "{0}长度少于{1}个字符")]
        [Display(Name = "密码")]
        public string Password { get; set; }        

        /// <summary>
        /// 确认密码
        /// </summary>
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "必须输入{0}")]
        [Compare("Password", ErrorMessage = "两次输入的密码不同")]
        [Display(Name = "确认密码")]
        public string ConfirmPassword { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [DataType(DataType.EmailAddress)]
        [Required(ErrorMessage = "必须输入{0}")]
        [Display(Name = "邮箱")]
        public string Email { get; set; }

        /// <summary>
        /// 联系方式
        /// </summary>
        [DataType(DataType.PhoneNumber)]
        [Required(ErrorMessage = "必须输入{0}")]
        [Display(Name = "联系方式")]
        public string Phone { get; set; }
    }
}